unit uBladeDancerScript;

interface

uses uCommonScript, SysUtils, uParamsController, uMainData, uConstants,
    fMain;

const
    atDanceMystic               = 12;
    atDanceofConcentration      = 13;
    atSirenDance                = 14;
    atDanceofAnger              = 15;
    atDanceofInspiration        = 16;
    atDanceofWarrior            = 17;
    atGetDuals                  = 18;
    atGetFists                  = 19;

const
    BladeDancerReUseTime: array [12..23] of TDateTime =
    (116/86400, 117/86400, 118/86400, 119/86400,
     116/86400, 117/86400, 118/86400, 119/86400, 0, 0, 0, 0);

type
    TBladeDancerScript = class(TCommonScript)
    private
        procedure AnalisData; override;
 {       procedure SelfControll;   }
    public
        constructor Create;
        destructor Destroy;
  {      procedure LaunchScript;  }
    end;

implementation

constructor TBladeDancerScript.Create;
var
    i: integer;
begin
    inherited;
    for i := 12 to High(FReUseTime) do
    begin
        FReUseTime[i] := BladeDancerReUseTime[i];
    end;
end;

destructor TBladeDancerScript.Destroy;
begin
    inherited;
end;

procedure TBladeDancerScript.AnalisData;
begin
    inherited;
    if Main.cbScript.Checked then
    begin
        if Now - FLastUse[atDanceofAnger] >= FReUseTime[atDanceofAnger] then
        begin
            AddNewAction(atMoveForward, plHeight, 1000);
            AddNewAction(atDanceofAnger, plNormal, 7000);
        end;
        if MainData.TargetMP > 0 then
        begin
            AddNewAction(atChangeTarget, plHeight);
            exit;
        end;
        if MainData.TargetHP > 0 then
        begin
            if MainData.TargetMP = 0 then
            begin
                AddNewAction(atAttack, plLow);
            end;
        end
        else
        begin
            sleep(1500);
            AddNewAction(atChangeTarget, plHeight);
        end;
    end;
end;

end.
